﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anke.SHManage.Utility
{
   public class EnumSqlAppnd  //2020-12-02 zch  枚举字典类 
    {
       //获取事件类型字典所有拼接语句
       public static string TZAlarmEventType()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZAlarmEventType suit in Enum.GetValues(typeof(E_TZAlarmEventType)))
           {               
               sb.Append(@"  DECLARE @" + suit + " int");           
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();       
       }

       //获取事件类型字典所有拼接语句
       public static string TZAcceptEventType()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZAcceptEventType suit in Enum.GetValues(typeof(E_TZAcceptEventType)))
           {
               sb.Append(@"  DECLARE @" + suit + " int");
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();
       }

       public static string TZTaskAbendReason()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZTaskAbendReason suit in Enum.GetValues(typeof(E_TZTaskAbendReason)))
           {
               sb.Append(@"  DECLARE @" + suit + " int");
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();
       }

       //获取事件类型字典所有拼接语句
       public static string TZAlarmEventOrigin()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZAlarmEventOrigin suit in Enum.GetValues(typeof(E_TZAlarmEventOrigin)))
           {
               sb.Append(@"  DECLARE @" + suit + " int");
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();
       }
       ////获取事件类型字典所有拼接语句
       public static string TZAlarmCallType()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZAlarmCallType suit in Enum.GetValues(typeof(E_TZAlarmCallType)))
           {
               sb.Append(@"  DECLARE @" + suit + " int");
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();
       }

       ////获取车辆暂停原因字典所有拼接语句
       public static string TZPauseReason()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZPauseReason suit in Enum.GetValues(typeof(E_TZPauseReason)))
           {
               sb.Append(@"  DECLARE @" + suit + " int");
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();
       }

       ////获取挂起原因字典所有拼接语句
       public static string TZHangUpReason()
       {
           StringBuilder sb = new StringBuilder();
           foreach (E_TZHangUpReason suit in Enum.GetValues(typeof(E_TZHangUpReason)))
           {
               sb.Append(@"  DECLARE @" + suit + " int");
               sb.Append(@" set @" + suit + "=" + (int)suit + @" ");
           }
           return sb.ToString();
       }

    }
}
